<template>
	<div class="msg_box" v-show="show_msg_box">
		<div class="msg_body">
			<div class="msg_header">
				<span class="f_name">新增</span>
				<span class="close_btn" @click="close_my_msg">×</span>
			</div>
			<slot></slot>
			<div class="msg_footer">
				<el-button type="primary" @click="submit_my_msg">确定</el-button>
				<el-button @click="close_my_msg">取消</el-button>
			</div>
		</div>
	</div>
</template>
<script>
export default {
	props:['show_msg_box'],
	methods:{
		close_my_msg(){
			this.$emit('close-msg');
		},
		submit_my_msg(){
			this.$emit('sub-msg')
		}
	}
}
</script>
<style lang="scss" scoped>
.msg_box{
	position: fixed;
	top: 50%;
	left: 50%;
	background: rgba(0,0,0,0.1);
	z-index: 2;
	transform: translate(-50%,-50%);
	box-shadow: 0 0px 18px 10px rgba(0, 0, 0, .12);
}
.msg_body .msg_header{
	display: flex;
	justify-content: space-between;
	border-bottom: 1px solid #e2e2e2;
	line-height: 40px;
}
.f_name{
	font-size: 20px;
}
.close_btn{
	font-size: 28px;
	line-height: 30px;
}
.msg_body{
	background: #fff;
	border-radius: 2px;
	z-index: 2;
	// height: 280px;
	padding:5px 15px 15px;
	box-sizing: border-box;
}
.msg_footer{
	display: flex;
	justify-content: flex-end;
	padding: 15px 0 0;
	border-top: 1px solid #e2e2e2;
}
</style>